﻿@model IList<SpotsHub.RouteService.Data.Driver>
@using Telerik.Web.Mvc;
@using Telerik.Web.Mvc.UI

<div>
    <table class="adminContent">
        <tr>
            <td>
                @(Html.Telerik().Grid(Model)
                .Name("available-drivers")
                .Columns(columns =>
                {
                    columns.Bound(x => x.Id)
                        .Template(x => string.Format("<input type='checkbox' name='checkedRecords' value='{0}' class='checkboxGroups'/>", x.Id))
                        .ClientTemplate("<input type='checkbox' name='checkedRecords' value='<#= Id #>' class='checkboxGroups'/>")
                        .Title("<input id='mastercheckbox' type='checkbox'/>")
                        .Width(50)
                        .HtmlAttributes(new { style = "text-align:center" })
                        .HeaderHtmlAttributes(new { style = "text-align:center" });
                    columns.Bound(x => x.DisplayName);
                    columns.Bound(x => x.PreferredLocalitiesString);
                })
                .Pageable(settings => settings.Total(Model.Count).PageSize(5).Position(GridPagerPosition.Both))
                .DataBinding(dataBinding => dataBinding.Ajax().Select("AvailableDriversList", "Manage"))
                .EnableCustomBinding(true))
            </td>
        </tr>
    </table>
</div>
